﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;
using ElMexicanos.Base;
using Microsoft.Xna.Framework;
using ElMexicanos.Base.Models;

namespace ElMexicanos.Components.Screens.Game
{
    class HudScreen : GameScreen
    {

        List<Sprite> spritesList;


        ContentManager content;
        Texture2D backgroundTexture;
       

        GraphicsDeviceManager graphics;
        SpriteBatch spriteBatch;


        /// <summary>
        /// Constructor.
        /// </summary>
        public HudScreen()
        {
            TransitionOnTime = TimeSpan.FromSeconds(0.5);
            TransitionOffTime = TimeSpan.FromSeconds(0.5);

            spritesList = new List<Sprite>();
        }

        /// <summary>
        /// Init the sprites
        /// </summary>
        public override void Initialize()
        {
            
            
        }


        /// <summary>
        /// Loads graphics content for this screen. The background texture is quite
        /// big, so we use our own local ContentManager to load it. This allows us
        /// to unload before going from the menus into the game itself, wheras if we
        /// used the shared ContentManager provided by the Game class, the content
        /// would remain loaded forever.
        /// </summary>
        public override void LoadContent()
        {
           


        }


        /// <summary>
        /// Unloads graphics content for this screen.
        /// </summary>
        public override void UnloadContent()
        {
            content.Unload();
        }



        /// <summary>
        /// Updates the background screen. Unlike most screens, this should not
        /// transition off even if it has been covered by another screen: it is
        /// supposed to be covered, after all! This overload forces the
        /// coveredByOtherScreen parameter to false in order to stop the base
        /// Update method wanting to transition off.
        /// </summary>
        public override void Update(GameTime gameTime, bool otherScreenHasFocus,
                                                       bool coveredByOtherScreen)
        {
            foreach (Sprite s in spritesList)
            {
                s.Update();
            }
           
            base.Update(gameTime, otherScreenHasFocus, false);
        }


        /// <summary>
        /// Draws the background screen.
        /// </summary>
        public override void Draw(GameTime gameTime)
        {
            SpriteBatch spriteBatch = ScreenManager.SpriteBatch;
            spriteBatch.Begin();

            foreach (Sprite s in spritesList)
            {
                s.Draw(spriteBatch);
            }

            spriteBatch.End();
         
            base.Draw(gameTime);
        }



    }
}
